<template>
  <div class="about">
    <h1>This is an about page</h1>
    <img :src="userInfo.avatar" style="width:190px;height:190px;" alt="">
    <h2>{{ userInfo.nickname }}</h2>
    <button @click="getFun">get</button>
    <button @click="postFun">post</button>
  </div>
</template>
<script>

// import { get ,post} from '../utils/fetch'
export default {
  name:'About',
  data() {
    return {
      userInfo:{
        avatar:'',
        nickname:''
      }
    }
  },
  created() {
      this.getFun()
    },
    methods: {
      async getFun(){
        const data = await this.yGet('user/userInfo',{
          params:{
            id:'60409c0056ae60584bb0b2df'
          }
        })
        if(data){
          this.userInfo = data
        }
      },
      async postFun(){
        const data = await this.yPost('user/userInfo',{
          params:{
            id:'60409c0056ae60584bb0b2df'
          }
        })
        if(data){
          this.userInfo = data
        }
      }
    },
}
</script>
